﻿// -------------------------------------------------------------------------
//    @FileName         :    NFMapUtil.h
//    @Author           :    gaoyi
//    @Date             :    24-8-30
//    @Email            :    445267987@qq.com
//    @Module           :    NFMapUtil
//
// -------------------------------------------------------------------------

#pragma once

#include <NFLogicCommon/NFLogicShmTypeDefines.h>

#include "proto_cs.nanopb.h"
#include "proto_cs.pb.h"
#include "proto_svr_map.pb.h"

#define DEFAULT_ENTER_CITY_MAP_ID (13)
#define GUILD_STATION_MAP_ID      (99)

class NFMapPart;
class NFPlayer;

class NFMapUtil
{
public:
    static NFMapPart* GetMapPart(NFPlayer* pPlayer);
    static const NFMapPart* GetMapPart(const NFPlayer* pPlayer);

public:
    static int CheckEnterMap(NFPlayer* pPlayer, int iMapId);
    static int CheckAreaInfo(NFPlayer* pPlayer);
    static int CheckStartEnterMap(NFPlayer* pPlayer, const proto_ff::Proto_CSMapQueryReq& oCSReq);
    static int NeedEnterDefault(NFPlayer* pPlayer, int iMapId);

public:
    static int SynCityRoleInfo(NFPlayer* pPlayer, proto_ff::enCityRoleInfoChgReason enReason = proto_ff::EN_CRICR_NONE);
public:
    static int StartEnterDefaultCity(NFPlayer* pPlayer);
    static int StartEnterMap(NFPlayer* pPlayer, const proto_ff::Proto_CSReq& csReq);
    static int HandleGCMapMsgRsp(const proto_ff::Proto_GCMapMsgRsp& gcMapMsgRsp, const ExtraLevelEntrancePara& stData);
    static int EnterMapRsp(const proto_ff::Proto_GCMapMsgRsp& gcMapMsgRsp, const ExtraLevelEntrancePara& stData);
    static int LeaveMapRsp(const proto_ff::Proto_GCMapMsgRsp& gcMapMsgRsp, const ExtraLevelEntrancePara& stData);
    static int HandleMapQuery(NFPlayer* pPlayer, int iMapObjId, const proto_ff::Proto_CSMapQueryReq& oCSMapQueryReq, const proto_ff::GCMapMsgRspData& rspData, uint32_t iToken);
};
